﻿#ifndef CONSTVALUENODEGRAPHICSITEM_H
#define CONSTVALUENODEGRAPHICSITEM_H
#include "DAStandardNodeTextGraphicsItem.h"
#include <QGraphicsProxyWidget>
#include <QGraphicsTextItem>
#include "ConstValueNode.h"
class QFocusEvent;
class QGraphicsSceneMouseEvent;
/**
 * @brief 常数节点
 */
class ConstValueNodeGraphicsItem : public DA::DAStandardNodeTextGraphicsItem
{
public:
    ConstValueNodeGraphicsItem(ConstValueNode* n, QGraphicsItem* p = nullptr);
    ~ConstValueNodeGraphicsItem();
    virtual void nodeDisplayNameChanged(const QString& name);
    // 获取当前的值
    QVariant::Type getCurrentValueType() const;
    void setCurrentValueType(QVariant::Type v);
    // 内部维护窗口，paintbody不做任何动作
    void paintBody(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget, const QRectF& bodyRect) override;

    // 轮廓圆角
    qreal getRectRadius() const;
    void setRectRadius(qreal newRectRadius);

private:
    qreal mRectRadius { 5 };  ///< 外轮廓的圆角
    QVariant::Type mValueType;
};

#endif  // CONSTVALUENODEGRAPHICSITEM_H
